﻿using Myotragus.Data;
using Myotragus.Data.Containers;
using Myotragus.Data.Emit;
using Myotragus.Store.Model.Tests.Domain;
using NUnit.Framework;

namespace Myotragus.Store.Model.Tests
{
  [TestFixture]
  class RepositoryFixture
  {
    [SetUp]
    public void SetUp()
    {
      FixtureHelper.InitializeServices();

      var auto = FixtureHelper.Container.Resolve<IAutoProperties>();
      var enti = FixtureHelper.Container.Resolve<IEntitiesRegistrar>();
      
      ((ITypeRegistrar) enti).RegisterForAll(auto.GetImplementation(typeof(IObject)));
    }

    [Test]
    public void Test()
    {
      var prov1 = FixtureHelper.Container.Resolve<IRepository<IObject>>();
      var obj = prov1.New();
      var obj2 = prov1.New(new { Id = 10, Name = "Erich" });

      FixtureHelper.Print(obj2);
    }
  }
}
